package com.tanhua.manage.controller;

import com.tanhua.manage.domain.OperLog;
import com.tanhua.manage.service.AnalysisService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dashboard")
@Slf4j
public class AnalysisController {

    @Autowired
    private AnalysisService analysisService;

    /**
     * 接口名称：概要统计信息
     * 接口路径：GET/dashboard/summary
     */
    @GetMapping("/summary")
    public ResponseEntity<Object> summary(){
        return analysisService.summary();
    }




    /**
     * 接口名称：统计新增用户、活跃用户、次日留存率
     * 接口路径：GET/dashboard/users
     */
    @GetMapping("/users")
    public ResponseEntity<Object> queryAnalysisUsers(Long sd, Long ed, Integer type){
        log.info("接口名称：统计新增用户num_registered、" + "活跃用户num_active、" + "次日留存率num_retention1d");
        return analysisService.queryAnalysisUsers(sd,ed,type);

    }













}
